#include "GameControls.hh"

using namespace Gui;

GameControls::GameControls(QWidget *parent):
    QWidget(parent)
{
	ui.setupUi(this);
}

GameControls::~GameControls() {}

void GameControls::next_turn_click_handler() {
    emit next_turn_clicked();
}

void GameControls::exit_click_handler() {
    emit exit_clicked();
}

void GameControls::chat_send_handler() {
	QLineEdit* chatNewMessage = findChild< QLineEdit* >("chatNewMessage");
	if (chatNewMessage && chatNewMessage->text().length() > 0)
	{
		emit chat_send_clicked(chatNewMessage->text());
		chatNewMessage->clear();
	}
}
